package com.asman.vr.network

import androidx.annotation.MainThread
import java.util.concurrent.Executor

class CallAnswerRepository(private val api: Api, private val networkExecutor: Executor?) {

    @MainThread
    fun rejectAnswer(body: RejectAnswerBody) = liveDataNull(api.rejectAnswer(body))

    @MainThread
    fun hangUp(
        roomId: Int?,
        schemeId: Long?,
        vrType: Int?
    ) = liveData(api.hangUp(HangUpBody(roomId, schemeId, vrType)))

    @MainThread
    fun hasReceived(
        roomId: Int?,
        schemeId: Long?,
        vrType: Int?
    ) = liveData(api.hasReceived(HangUpBody(roomId, schemeId, vrType)))

    @MainThread
    fun canReceived(roomId: Int) = liveData(api.canReceived(roomId))

    @MainThread
    fun getTrtcAuthInfo(schemeId: Long?, vrType: Int?) =
        liveData(api.getTrtcAuthInfo(schemeId, vrType))

    @MainThread
    fun submitTrtcLog(roomId: Int?, userId: Long?) =
        liveData(api.submitTrtcLog(TrtcLogBody(TRTC_TYPE.log10.value, roomId, userId)))

    @MainThread
    fun submitTrtcLogSimple(roomId: Int?, userId: Long?) =
        api.submitTrtcLog(TrtcLogBody(TRTC_TYPE.log10.value, roomId, userId))

}